<!--考勤卡中心-已停用的考勤卡-->
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="my" uri="http://www.trkj.com/tr1702/tags" %>
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript"
	src="<c:url value="/js/jquery-easyui-1.5.5.6/jquery.min.js"  />"></script>
<script type="text/javascript"
	src="<c:url value="/js/jquery-easyui-1.5.5.6/jquery.easyui.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/js/jquery-easyui-1.5.5.6/locale/easyui-lang-zh_CN.js"/>"></script>
<link rel="stylesheet" type="text/css"
	href="<c:url value="/js/jquery-easyui-1.5.5.6/themes/default/easyui.css"/>" />
<link rel="stylesheet" type="text/css"
	href="<c:url value="/js/jquery-easyui-1.5.5.6/themes/icon.css"/>">
<title>考勤卡中心-已停用的考勤卡</title>
</head>
<body>
	<script type="text/javascript">
	var timecard_stop =function(value,row,index){
		var timecar_no_only_stop="";
		<my:g id="32">timecar_no_only_stop= "<a style='' btn='timecard_stop_btn_only' onclick='onlytimecar_no_stop(" + row.TIMECARD_ID + ","+row.TIMECARD_ZT+")'>启用</a>";</my:g>
		return timecar_no_only_stop;
	}
	$("#dgcard_with_center_stop").datagrid({
		onLoadSuccess:function(){
			$("a[btn=timecard_stop_btn_only]").linkbutton({iconCls:'icon-update_red', plain:true});
		}
	});
	$(".is_timecard_stop").click(function(){
		var href=$(this).attr("data-text");
		$("#timecard_center_stop").panel({    
		    href:href,    
		    onLoad:function(){    
		        
		    }    
		}); 
	});
		//启用考勤卡
		var onlytimecar_no_stop =function(Id_stop,stop_state){
			var sstate =1;
			if(stop_state==1){
				sstate=0;
				$.messager.confirm('确认', '您确定要开启该考勤卡吗？', function(v){
					if(v){
						$.post("is_open_timecard", {timecardId: Id_stop,timecardZt:sstate}, function(v){
							if(v.success){
								$('#dgcard_with_center_stop').datagrid('reload');
							}else{
								$.messager.alert('错误', v.message);
							}
						});
					}else{
						
					}
					
				}); 
			}else if(stop_state==0){
				sstate=1;
				$.messager.confirm('确认', '您确定要关闭该规则吗？', function(v){
					if(v){
						$.post("is_open_timecard", {timecardId: Id_stop,timecardZt:sstate}, function(v){
							if(v.success){
								$('#dgcard_with_center_stop').datagrid('reload');
							}else{
								$.messager.alert('错误', v.message);
							}
						});
					}else{
						
					}
					
				}); 
			}
		}
		//刷新
		$("#center_stop_reload_is").linkbutton({
			onClick:function(){
				$("#dgcard_with_center_stop").datagrid("reload");
			}
		});
	</script>
	<div id="timecard_center_stop" class="easyui-panel" data-options="fit:true,border:false">   
    
	
	<table id="dgcard_with_center_stop"  class="easyui-datagrid"
	data-options="
				fitColumns:true,
				fit:true,
				url:'is_to_findTimecardBystaeOne',
				method:'get',
				pagination:true,     
				pageSize:10,    
				pageList: [10,20,30,40,50], 
				rownumbers:true,
				Striped:true, 
				singleSelect:true,
				striped:true,
				toolbar:'#tbcard_center_stop'
        ">
		<thead>
			<tr>

				<th align="center" data-options="field:'TIMECARD_ID',width:50">考勤卡</th>
				<th align="center" data-options="field:'TIMECARD_PERSON',width:55">创建者</th>
				<th align="center" data-options="field:'TIMECARD_DATE',width:110,formatter:function(value,row,index){
					if(value!=null){
						var date = new Date(value);
						return date.toLocaleString();
					}
					return; 
				}">创建日期</th>
				<th align="center" data-options="field:'TIMECARD_UPDATE',width:110,formatter:function(value,row,index){
					if(value!=null){
						var date = new Date(value);
						return date.toLocaleString();
					}
					return; 
				}">更新日期</th>
				<th align="center" data-options="field:'TIMECARD_ZT',width:60,hidden:true"></th>
				<th align="center" data-options="field:'xxx',width:60,formatter:timecard_stop"></th>
				<th align="center" data-options="field:'xxx1',width:270"></th>
			</tr>
		</thead>
	</table>
	<div id="tbcard_center_stop">
		<!-- <a href="#" class="easyui-linkbutton"
			data-options="iconCls:'icon-add',disabled:true">新增</a> -->
			<span class="xtb-sep_center"></span>
		<a href="#" class="easyui-linkbutton"
			data-options="iconCls:'icon-reload'" id="center_stop_reload_is">刷新</a>
			<span class="xtb-sep_center"></span>
			<a href="#"
			class="easyui-menubutton"
			data-options="menu:'#mm1_no_stop',iconCls:'icon-edit'">凭证列表</a> <input
			class="easyui-textbox" data-options="prompt:'考勤卡'"
			style="width: 150px" id="timecard_center_no_text"> <a class="easyui-linkbutton"
			data-options="iconCls:'icon-search'" id="timecard_center_no">搜素</a>
	</div>

	<!-- 选择操作面板 -->
	<div id="mm1_no_stop" style="width: 150px;">
		<div data-options="iconCls:'icon-undo'" class="is_timecard_stop" data-text="to_time_card_center_nos">未分配的考勤卡</div>
		<div data-options="iconCls:'icon-redo'" class="is_timecard_stop"data-text="to_is_timecard_center_exchange">已分配的考勤卡</div>
		<div data-options="iconCls:'icon-redo'" class="is_timecard_stop"data-text="to_is_timecard_center_stop" style="color:red;">已停用的考情卡</div>
	</div>
	
	</div> 
	
</body>
</html>